package com.macro.mall.product.task;

import com.macro.mall.product.service.PmProdStockTaskService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Slf4j
@Component
public class CycleStockInitTask {

    @Autowired
    private PmProdStockTaskService pmProdStockTaskService;

    @Scheduled(cron = "30 0/5 * ? * ?")
    private void initCycleStock(){
        log.info("★★★★★★★★★★★★★★★★★★★★★★★★★★初始化库存定时任务执行开始");
         pmProdStockTaskService.initCycleStock();
        log.info("★★★★★★★★★★★★★★★★★★★★★★★★★★初始化库存定时任务执行结束");
    }
    @Scheduled(cron = " 0  0/5  *  ? * ?")
    private void handleStockTaskData(){
        log.info("★★★★★★★★★★★★★★★★★★★★★★★★★★ 处理库存任务执行开始");
        pmProdStockTaskService.handleStockTaskData();
        log.info("★★★★★★★★★★★★★★★★★★★★★★★★★★处理库存任务执行结束");
    }
}
